package com.swt.draw.service.impl;

import com.swt.draw.dao.RoleMapper;
import com.swt.draw.entity.Role;
import com.swt.draw.example.RoleExample;
import com.swt.draw.service.RoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName
 * @Description TODO
 * @Author Administrator
 * @Date 2019/8/29 0029 23:17
 * @Version 1.0
 **/
@Service("roleService")
public class RoleServiceImpl implements RoleService {
    @Resource
    private RoleMapper roleMapper;

    @Override
    public List<Role> getAllRoles() {
        RoleExample example = new RoleExample();
        RoleExample.Criteria criteria = example.createCriteria();
        criteria.andRoleStatusEqualTo((short) 0);
        List<Role> roles = roleMapper.selectByExample(example);
        return roles;
    }
}
